﻿using System;
using System.Collections.Generic;
using Shapes;
using UnityEngine;

namespace Gp.Scripts.GUI {
    public class SkillRadiusIndicator : MonoBehaviour {
        private static readonly Vector3 offset = new(0, 0.02f, 0);
        [SerializeField] private List<Disc> discs;
        [SerializeField] private float offsetSpeed = 0.02f;
        private void FixedUpdate() {
            foreach (var disc in this.discs) {
                disc.DashOffset += offsetSpeed;
            }
        }


        public void Display(Vector3 center, float radius) {
            foreach (var disc in discs) {
                disc.transform.position = center + offset;
                disc.Radius = radius;
                disc.enabled = true;
            }
        }

        public void Clear() {
            foreach (var disc in discs) {
                disc.enabled = false;
            }
        }
    }
}